// 封装banner轮播图相关业务代码
import { getBannerAPI } from '@/apis/home';
import { onMounted, ref } from 'vue';

export function useBanner() {
  // 获取轮播图数据
  const bannerList = ref([])
  const getBannerList = async (distributionSite) => {
    const res = await getBannerAPI({
      distributionSite
    })
    bannerList.value = res.result
  }

  onMounted(() => {
    getBannerList(2)
  })

  return {
    bannerList
  }
}
